Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2MiniPlatform = require("MiniPlatform");
var $2Platformconf = require("Platformconf");
var def_PlatformMgr = /* */function () {
  function _ctor() {
    babel_classCallCheck(this, _ctor);
    this.platform = null;
  }
  return babel_createClass(_ctor, [{
    key: "init",
    value: function init(e) {
      if ($2Platformconf.default.PlatformType != $2Platformconf.ePlatformType.Pc) {
        if ($2Platformconf.default.PlatformType > $2Platformconf.ePlatformType.Pc && $2Platformconf.default.PlatformType <= $2Platformconf.ePlatformType.ZFBGame) {
          this.platform = $2MiniPlatform.default.Instance, this.platform && this.platform.init(e);
        }
        if (!this.platform) {
          this.platform = null, console.log("主平台初始化失败");
        }
      }
    }
  }, {
    key: "login",
    value: function login(e, t) {
      if (this.platform) {
        this.platform.login(e, t);
      } else {
        this.loginCallBack();
      }
    }
  }, {
    key: "loginCallBack",
    value: function loginCallBack() {}
  }, {
    key: "logout",
    value: function logout() {
      this.platform && this.platform.logOut();
    }
  }, {
    key: "share",
    value: function share(e, t) {
      this.platform && this.platform.share(e, t);
    }
  }, {
    key: "play_AD",
    value: function play_AD(e, t) {
      if (cc.sys.isBrowser) {
        e && e(true);
      } else {
        this.platform.play_AD(e, t);
      }
    }
  }, {
    key: "addShortcut",
    value: function addShortcut(e) {
      if (this.platform) {
        this.platform.addShortcut(e);
      } else {
        e(true);
      }
    }
  }, {
    key: "checkShortcut",
    value: function checkShortcut(e) {
      console.log("添加桌面");
      if (this.platform) {
        this.platform.checkShortcut(e);
      } else {
        e(true);
      }
    }
  }, {
    key: "interstitialShow",
    value: function interstitialShow(e) {
      console.log("interstitialShow1", e);
      this.platform && this.platform.interstitialShow(e);
    }
  }, {
    key: "bannerDestroy",
    value: function bannerDestroy(e) {
      this.platform && this.platform.bannerDestroy(e);
    }
  }, {
    key: "bannerCreate",
    value: function bannerCreate(e, t) {
      this.platform && this.platform.bannerCreate(e, t);
    }
  }, {
    key: "bannerrefreshAD",
    value: function bannerrefreshAD(e, t) {
      this.platform && this.platform.bannerrefreshAD(e, t);
    }
  }, {
    key: "bannerShow",
    value: function bannerShow(e, t) {
      this.platform && this.platform.bannerShow(e, t);
    }
  }, {
    key: "bannerHide",
    value: function bannerHide(e) {
      this.platform && this.platform.bannerHide(e);
    }
  }, {
    key: "bannertempHide",
    value: function bannertempHide() {
      this.platform && this.platform.bannertempHide();
    }
  }, {
    key: "bannertempShow",
    value: function bannertempShow() {
      this.platform && this.platform.bannertempShow();
    }
  }, {
    key: "blockADshow",
    value: function blockADshow(e, t) {
      this.platform && this.platform.blockADshow(e, t);
    }
  }, {
    key: "blockADhide",
    value: function blockADhide(e) {
      this.platform && this.platform.blockADhide(e);
    }
  }, {
    key: "showNativeAD",
    value: function showNativeAD(e, t) {
      this.platform && this.platform.showNativeAD(e, t);
    }
  }, {
    key: "destroyNativeAD",
    value: function destroyNativeAD() {
      this.platform && this.platform.destroyNativeAD();
    }
  }, {
    key: "reportAdShow",
    value: function reportAdShow(e) {
      this.platform && this.platform.reportAdShow(e);
    }
  }, {
    key: "showGamePortalAd",
    value: function showGamePortalAd(e) {
      this.platform && this.platform.showGamePortalAd(e);
    }
  }, {
    key: "hideGamePortalAd",
    value: function hideGamePortalAd(e) {
      this.platform && this.platform.hideGamePortalAd(e);
    }
  }, {
    key: "loadSubpackage",
    value: function loadSubpackage(e, t) {
      if (this.platform) {
        this.platform.loadSubpackage(e, t);
      } else {
        t.success && t.success();
      }
    }
  }, {
    key: "showCustomAd",
    value: function showCustomAd(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
      this.platform && this.platform.showCustomAd(e, t, n);
    }
  }, {
    key: "loadCustomAd",
    value: function loadCustomAd(e, t) {
      var n = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;
      this.platform && this.platform.loadCustomAd(e, t, n);
    }
  }, {
    key: "hideCustomAd",
    value: function hideCustomAd(e) {
      this.platform && this.platform.hideCustomAd(e);
    }
  }, {
    key: "destroyCustomAd",
    value: function destroyCustomAd(e) {
      this.platform && this.platform.destroyCustomAd(e);
    }
  }, {
    key: "loadGridAd",
    value: function loadGridAd(e, t, n) {
      var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "black";
      this.platform && this.platform.loadGridAd(e, t, n, o);
    }
  }, {
    key: "showGridAd",
    value: function showGridAd(e, t, n) {
      var o = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "black";
      this.platform && this.platform.showGridAd(e, t, n, o);
    }
  }, {
    key: "hideGridAd",
    value: function hideGridAd(e) {
      this.platform && this.platform.hideGridAd(e);
    }
  }, {
    key: "destroyGridAd",
    value: function destroyGridAd(e) {
      this.platform && this.platform.destroyGridAd(e);
    }
  }, {
    key: "loadBannerBoxAd",
    value: function loadBannerBoxAd() {
      this.platform && this.platform.loadBannerBoxAd();
    }
  }, {
    key: "showBannerBoxAd",
    value: function showBannerBoxAd(e) {
      this.platform && this.platform.showBannerBoxAd(e);
    }
  }, {
    key: "hideBannerBoxAd",
    value: function hideBannerBoxAd() {
      this.platform && this.platform.hideBannerBoxAd();
    }
  }, {
    key: "destroyBannerBoxAd",
    value: function destroyBannerBoxAd() {
      this.platform && this.platform.destroyBannerBoxAd();
    }
  }, {
    key: "clickNativeAD",
    value: function clickNativeAD(e) {
      this.platform && this.platform.clickNativeAD(e);
    }
  }], [{
    key: "Instance",
    value: function Instance() {
      null == _ctor.instance && (_ctor.instance = new _ctor());
      return _ctor.instance;
    }
  }]);
}();
exports.default = def_PlatformMgr;
def_PlatformMgr.instance = null;